#pragma once

#include "UserComment.h"
#include "Common/Common.h"
#include <vector>
#include <string>
#include <sstream>

struct NetflixDataElement
{
public:
	std::string _title;
	std::vector<std::string> _directors;
	std::vector<std::string> _cast;
	std::vector<std::string> _genres;
	std::string _mainGenre;
	CATEGORY _category;

	std::string Content2Str()
	{
		std::stringstream ss;

		for(int i = 0; i < _directors.size(); i++)
			ss << _directors[i] << " ";

		for(int i = 0; i < _cast.size(); i++)
			ss << _cast[i] << " ";

		ss << _mainGenre << " ";
		ss << _title;
		//for(int i = 0; i < _userComments.size(); i++)
		//	ss << _userComments[i].Comment() << " ";

		return ss.str();
	}

	double _netflixRating;
	std::vector<UserComment> _userComments;
	int _movieId;

	NetflixDataElement(void);
	NetflixDataElement(std::string title, std::vector<std::string> directors, std::vector<std::string> cast,
		std::vector<std::string> genres, std::vector<UserComment> userComments, double netflixRating, int movieId);
	NetflixDataElement(std::string title, double netflixRating, int movieId);
	~NetflixDataElement(void);

	int getMovieId();
	CATEGORY& getCategory();

	NetflixDataElement& operator=(NetflixDataElement data)
	{
		this->_title		= data._title;
		this->_directors	= data._directors;
		this->_genres		= data._genres;
		this->_netflixRating = data._netflixRating;
		this->_userComments = data._userComments;
		this->_cast			= data._cast;

		if(_genres.size() > 0) {
			this->_mainGenre = _genres[_genres.size()-1]; 
			this->_category = parseCategory(_mainGenre);
		}

		return *this;
	}

	std::string& getMainGenre();
	void setMainGenre(std::string);

	std::vector<UserComment>& getUserComments();

	void getAvgSentimentFromComments(float&, float&);

	CATEGORY parseCategory(std::string);
	};

